import request from '@/utils/request'

// 查询 docker 镜像信息列表
export function listImage(query) {
  return request({
    url: '/docker/image/list',
    method: 'get',
    params: query
  })
}

// 查询 docker 未使用的镜像
export function listNoneImage(query) {
  return request({
    url: '/docker/image/none',
    method: 'get',
    params: query
  })
}

// 查询 docker 镜像信息
export function getImageDetail(query) {
  return request({
    url: '/docker/image/inspect',
    method: 'get',
    params: query
  })
}

// 查询 docker 镜像端口信息
export function getImagePort(query) {
  return request({
    url: '/docker/image/port',
    method: 'get',
    params: query
  })
}

// 搜索镜像
export function searchImage(query) {
  return request({
    url: '/docker/image/search',
    method: 'get',
    params: query
  })
}

// 拉取镜像
export function pullImage(data) {
  return request({
    url: '/docker/image/pull',
    method: 'post',
    data: data
  })
}

// 删除镜像
export function delImage(data) {
  return request({
    url: '/docker/image',
    method: 'delete',
    data: data
  })
}

// 清除镜像
export function pruneImage(query) {
  return request({
    url: '/docker/image/prune',
    method: 'delete',
    params: query
  })
}

// 构建镜像
export function buildImage(data) {
  return request({
    url: '/docker/image/build',
    method: 'post',
    data: data
  })
}

